﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once

#include "GmStructure.h"
#include "UniIdentity.h"

namespace gcmp
{
    class IDocument;
    enum class LineFamilyPositionCurveSideType;
    enum class BeamZPositioningType;
    enum class RaftFoundationZPositioningType;
    enum class StripFoundationZPositioningType;
    enum class WallHoleZPositioningType;
    enum class ConcreteStrengthGradeType;
    enum class InstanceEndType;

    class GM_STRUCTURE_EXPORT StructureInstancePresetParameterUtils
    {
    public:
        static bool GetPresetFamilyNameAndInstanceType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, std::wstring& familyName, std::wstring& instanceType);
        static bool SetPresetInstanceType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, ElementId instanceTypeId);
        static bool GetPresetBaseLevel(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, ElementId& baseLevelId);
        static bool GetPresetBaseLevelOffset(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& baseLevelOffset);
        static bool GetPresetTopLevel(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, ElementId& topLevelId);
        static bool GetPresetTopLevelOffset(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& topLevelOffset);
        static bool GetPresetStartOffset(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& startOffset);
        static bool GetPresetEndOffset(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& endOffset);
        static bool GetPresetStoryLevel(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, ElementId& storeyId);

#pragma region 墙预设参数
        static bool GetPresetWallHeight(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& height);
        static bool GetPresetWallStartHeight(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& height);
        static bool GetPresetWallEndHeight(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& height);
        static bool GetPresetWallStartOffset(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& offest);
        static bool GetPresetWallEndOffest(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& offest);
#pragma endregion 墙预设参数

        static bool GetPresetZPositioningType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, BeamZPositioningType& type);
        static bool GetPresetZPositioningType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, RaftFoundationZPositioningType& type);
        static bool GetPresetZPositioningType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, StripFoundationZPositioningType& type);
        static bool GetPresetZPositioningType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, WallHoleZPositioningType& type);
        static bool GetPresetConcreteStrengthGradeType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, ConcreteStrengthGradeType& type);

#pragma region 柱预设参数
        static bool GetPreSetColumnHeight(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& height);
#pragma region 柱预设参数

#pragma region 斜柱预设参数
        //获取预设顶部端面类型
        static bool GetPresetSlantedColumnTopFaceEndType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, InstanceEndType& type);
        //获取预设底部端面类型
        static bool GetPresetSlantedColumnBottomFaceEndType(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, InstanceEndType& type);
        //获取预设横截面旋转角度
        static bool GetPresetSlantedColumnSectionRotateAngle(const IDocument* pDoc, const UniIdentity& categoryUid, Int32 categorySecondKey, double& angle);
#pragma endregion 斜柱预设参数

    };
}
